package com.cby.operation.sdk

import android.content.Context

/**
 * 描述信息: SDK相关全局配置
 *
 * @author ChenBaoYang
 * @date 6/1/21 11:26
 */
object SdkConfiguration {

    /**
     * 全局application context
     */
    var appContext: Context? = null
        private set

    /**
     * 获取当前gameId配置
     * @return
     */
    lateinit var gameId: String
        private set

    /**
     * 当前游戏包名
     */
    private var sPackageName: String? = null

    /**
     * 当前游戏横竖屏
     */
    var orientation = 0
        private set

    fun init(context: Context, gameId: String, orientation: Int) {
        appContext = context.applicationContext
        SdkConfiguration.gameId = gameId
        SdkConfiguration.orientation = orientation
    }

    val packageName: String
        get() {
            if (sPackageName == null && appContext != null) {
                sPackageName = appContext!!.packageName
            }
            return ""
        }

    val sdkVersion: String
        get() = "1.0.3.0"

    /**
     * 全局用户ID
     */
    var userId: String = "0"
}